package com.shg.admin.mapper;

import com.shg.admin.bean.City;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CityMapper {
    
    @Select("SELECT * FROM t_city WHERE id = #{id}")
    City selectCityById(Long id);
    
    List<City> selectListCity();
    
    @Insert("INSERT INTO t_city (city, province, country) VALUES(#{city},#{province},#{country})")
    @Options(useGeneratedKeys = true,keyProperty = "id") // 拿到插入后的主键
    void insertCity(City city);
}
